#include<stdio.h>
#include<stdlib.h>
int main(){
    int y,m;
    int d;
    scanf("%d%d",&y,&m);
    if(m<=0||m>12||y<=0)
        d=-1;
    else if(m==2){
        if(y%4==0&&y%100!=0||y%400==0)
            d=29;
        else
            d=28;
    }
    else if(m==1||m==3||m==5||m==7||m==8||m==10||m==12)
        d=31;
    else
        d=30;

    if(d<0)
        puts("Are you kidding?");
    else
        printf("%d\n",d);
    return EXIT_SUCCESS;
}
